package com.itfreer.power.dao.jurisdiction;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

import org.springframework.beans.BeanUtils;

import com.itfreer.form.api.JdbcBaseEntity;
import com.itfreer.power.dao.base.JdbcTreeEntityBase;
import com.itfreer.power.entity.jurisdiction.MenuJurisdictionEntity;

/**
 * 菜单权限实体
 */
@Entity(name = "sso_jurisdiction_menu")
@Table(indexes = { 
        @Index(name="s_j_menu_code", columnList="s_code"),
        @Index(name="s_j_menu_pid", columnList="pid") })
public class JdbcMenuJurisdictionEntity extends JdbcTreeEntityBase implements JdbcBaseEntity<MenuJurisdictionEntity> {

	private static final long serialVersionUID = 2638817081794030611L;

	/**
	 * 菜单url地址
	 */
	@Column(name = "s_urls", nullable = true)
	private String urls;
	
	/**
	 * 所属注册的服务
	 */
	@Column(name = "s_registerService", nullable = true)
	private String registerService;

	/**
	 * 菜单url地址
	 */
	public String getUrls() {
		return urls;
	}

	/**
	 * 菜单url地址
	 */
	public void setUrls(String urls) {
		this.urls = urls;
	}
	
	/**
	 * 所属注册的服务
	 */
	public String getRegisterService() {
		return registerService;
	}

	/**
	 * 所属注册的服务
	 */
	public void setRegisterService(String registerService) {
		this.registerService = registerService;
	}
	
	@Override
	public void from(MenuJurisdictionEntity t) {
		BeanUtils.copyProperties(t, this);
	}

	@Override
	public MenuJurisdictionEntity toEntity() {
		MenuJurisdictionEntity toEntity = new MenuJurisdictionEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}
